package ae.pcfc.cldos.online.web.controller.login;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import ae.pcfc.cldos.online.common.exception.NoSuchCompanyException;
import ae.pcfc.cldos.online.common.vo.app.comments.ApplicationCommentVO;
import ae.pcfc.cldos.online.web.controller.base.BaseNewVisaController;
import ae.pcfc.cldos.online.web.model.BackOfficeAdminReview;

@Controller
@RequestMapping(value = "admin/general/comments")
public class TestCommentsPage  extends BaseNewVisaController{
	
	
	@RequestMapping(value = "/adminComments.htm", method = RequestMethod.GET)
	public void login(HttpServletRequest request) {
		
	}
	
	
	@ModelAttribute("BackOfficeAdminReview")
	public BackOfficeAdminReview populateCompanyInformationInfoModel(HttpServletRequest request) throws NoSuchCompanyException{
		
	return new BackOfficeAdminReview();

	}
	
	@ModelAttribute("commentsVOList")
	public List<ApplicationCommentVO> populateCommentsVo(HttpServletRequest request) throws NoSuchCompanyException{
		
		List<ApplicationCommentVO> response = new ArrayList<ApplicationCommentVO>();
	
		for (int i = 0 ; i < 5 ; i++){
			ApplicationCommentVO VO = new ApplicationCommentVO();
			VO.setApplicationStatus("Status" +(i+1));
			VO.setComment("Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.");
			VO.setDate(new Date());
			VO.setUsername("User" + (i+1));
			response.add(VO);
		}
		return response;

	}
}
